﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListPosition.aspx.cs" Inherits="ZX.WebApp.EditWidows.OrganizationalManager.ListPosition" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table id="DutyInfoTable">

            <tr>
                <td style="height:30px;">
                    职位名称
                </td>
                <td>
                    <input type="text" id="Name" name="Name" maxlength="100" runat="server" />
                </td>
                <td><span style="color: Red">*</span></td>
            </tr>
           
        </table>
    </div>
    </form>
</body>
<script type="text/javascript">
    var Entity="<%=Entitys %>",
        Url = "";
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>

    function Save() {
        var vName = $("#Name").val();

        if (vName == "") {
            alert("职位名称不能为空!");
            $("#Name").focus();
            return;
        }  else {
            $("#DutyInfoTable").SetFormValueToObject(instance[0]);
            var json = $.toJSON(instance[0]).replace(/'/g, "[B]");
   //修改
                Url = "DataProcessin.aspx?entity=" + Entity + "&action=Update&json=" + json;
 
            SaveData();
        }
    }
    function SaveData() {
        YAHOO.util.Connect.asyncRequest('POST', Url, {
            success: function (res) {
                var inventory;
                try {
                    inventory = res.responseText;
                    if (inventory == 1) {
                        alert("保存成功!");
                        parent.LoadDataById();
                    } else {
                        alert(inventory);
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
    }
</script>
</html>